package top.pengdong.pictureShare.tweet.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.validation.constraints.Null;

/**
 * 评论表
 * 
 * @author chenshun
 * @email pengshi12138@outlook.com
 * @date 2022-04-25 16:55:46
 */
@Data
@TableName("ps_comment")
public class PsCommentEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 唯一主键
	 */
	@TableId
	@Null
	private Long id;

	/**
	 * ip地址
	 */
	@JsonIgnore
	@Null
	private String location;
	/**
	 * ip属地
	 */
	@Null
	private String ipAddress;
	/**
	 * 文章id
	 */
	private Long tweetId;
	/**
	 * 用户id
	 */
	private Long userId;
	/**
	 * 被评论用户id
	 */
	private Long toUserId;


	@TableField(exist = false)
	private String nickname;
	@TableField(exist = false)
	private String toUserNickname;
	@TableField(exist = false)
	private String userAvatar;
	/**
	 * 用户名
	 */
	@JsonIgnore
	private String userName;

	/**
	 * 对于用户而言是不是点赞了
	 */
	@TableField(exist = false)
	private boolean isLike = false;
	/**
	 * 评论内容
	 */
	private String commentContext;
	/**
	 * 上级信息
	 */
	private Long pid;
	/**
	 * 创建时间
	 */
	@Null
	private Date createTime;
	/**
	 * 启用状态
	 */
	@Null
	@JsonIgnore
	@TableLogic
	private Integer status;
	/**
	 * 更新时间
	 */
	@JsonIgnore
	@Null
	private Date updateTime;


	/**
	 * 子评论列表
	 */
	@Null
	@TableField(exist = false)
	private List<PsCommentEntity> psCommentEntities;

}
